<template>
  <div >
      <el-row>
      <el-col :span="3" class="grid">
        <el-input
          v-model="intxt"
          placeholder="请输入内容"
          size="mini"   width="180"
        ></el-input>
      </el-col>
       <el-col :span="1" class="grid">
        <el-button type=" text" icon="el-icon-search" size="mini"
          >搜索</el-button
        >
      </el-col>
      </el-row>
       <br />
    <!--表格数据及操作-->
    <el-table
      :data="housing"
      border
      style="width: 100%"
      stripe
      ref="multipleTable"
      tooltip-effect="dark"
    >
     <!--勾选框-->
      <el-table-column type="selection" width="55" label="序号">
      </el-table-column>
      <!--索引-->
       <el-table-column type="index" :index="indexMethod"> </el-table-column>
      <el-table-column prop="id" label="编号" width="180" sortable>
      </el-table-column>
      <el-table-column prop="houseNumber" width="180" label="房屋门牌号"> </el-table-column>
      <el-table-column prop="live" label="是否有人居住" width="180">
      </el-table-column>
    </el-table>
 </div>
</template>

<script>
import axios from 'axios'
import myapi from '../api.js'
export default {
name:"housing",
data(){
  return{
    intxt:"",
    housing:[],
  }
},
mounted() {
    axios.post(myapi.housing.url).then((res) => {
      if (res.data) this.housing = res.data;
      else {
        this.$message.error("查询失败");
      }
    });
    this.page.totalRecords = this.products.length;
    this.page.totalPages = this.page.totalRecords / this.page.pageSize + 1;
  },
}
</script>

<style>
.div {
  margin: 50px auto;
}
</style>